<?php
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP
 *
 * This content is released under the MIT License (MIT)
 *
 * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * @package	CodeIgniter
 * @author	EllisLab Dev Team
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
 * @copyright	Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
 * @license	http://opensource.org/licenses/MIT	MIT License
 * @link	https://codeigniter.com
 * @since	Version 1.0.0
 * @filesource
* @property CI_Loader 	           $load	        :
* @property CI_DB_active_record    $db	            :
* @property CI_Calendar 	       $calendar	    :
* @property Email 	               $email	        :
* @property CI_Encrypt 	           $encrypt	        :
* @property CI_Ftp 	               $ftp	            :
* @property CI_Hooks 	           $hooks	        :
* @property CI_Image_lib 	       $image_lib	    :
* @property CI_Language 	       $language	    :
* @property CI_Log 	               $log	            :
* @property CI_Output 	           $output	        :
* @property CI_Pagination 	       $pagination	    :
* @property CI_Parser 	           $parser	        :
* @property CI_Session 	           $session	        :
* @property CI_Sha1 	           $sha1	        :
* @property CI_Table 	           $table	        :
* @property CI_Trackback 	       $trackback	    :
* @property CI_Unit_test 	       $unit	        :
* @property CI_Upload 	           $upload	        :
* @property CI_URI 	               $uri	            :
* @property CI_User_agent 	       $agent	        :
* @property CI_Validation 	       $validation	    :
* @property CI_Xmlrpc 	           $xmlrpc	        :
* @property CI_Zip 	               $zip	            :
* @property CI_Cache 	           $cache	        缓存类     构造参数:array('adapter' => 'apc', 'backup' => 'file', 'key_prefix' => 'my_')
* @property Admin_mdl			   $admin			管理员模型
* @property Admin_menu_mdl		   $menu			后台栏目模型
* @property Admin_role_mdl		   $role			后台角色模型
* @property App_version_mdl		   $version			APP版本模型
* @property Promotion_mdl		   $promotion 	    :推广模型
* @property Ranklist_mdl		   $rankList		:排行榜模型
* @property Task_category_mdl		  
* @property Task_image_mdl		   $taskImg	        :任务图片模型
* @property Task_mdl		       $task	        :任务模型
* @property Users_mdl 	           $users	        :用户模型
* @property User_task_mdl		   $userTask	    :用户任务模型
* @property UrlParse		       $UrlParse	    :URL解析类
* @property WechatPay		       $wechatPay	    :微信支付类
* @property Withdraw_mdl		   $withdraw	    :提现记录模型
* @property Warning_mdl		       $warning	        :可疑攻击信息模型
* @property User_revenues_mdl	   $userRevenues	:用户收益模型
* @property User_level_mdl		   $level			:用户等级模型
* @property Task_stages_mdl		   $taskStages		分期任务模型(mongo)
* @property JS						$js
* @property Mongo_db				$mongo
 */
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Application Controller Class
 *
 * This class object is the super class that every library in
 * CodeIgniter will be assigned to.
 *
 * @package		CodeIgniter
 * @subpackage	Libraries
 * @category	Libraries
 * @author		EllisLab Dev Team
 * @link		https://codeigniter.com/user_guide/general/controllers.html
 */
class CI_Controller {

	/**
	 * Reference to the CI singleton
	 *
	 * @var	object
	 */
	private static $instance;

	/**
	 * Class constructor
	 *
	 * @return	void
	 */
	public function __construct()
	{
		self::$instance =& $this;

		// Assign all the class objects that were instantiated by the
		// bootstrap file (CodeIgniter.php) to local class variables
		// so that CI can run as one big super object.
		foreach (is_loaded() as $var => $class)
		{
			$this->$var =& load_class($class);
		}

		$this->load =& load_class('Loader', 'core');
		$this->load->initialize();
		log_message('info', 'Controller Class Initialized');
	}

	// --------------------------------------------------------------------

	/**
	 * Get the CI singleton
	 *
	 * @static
	 * @return	object
	 */
	public static function &get_instance()
	{
		return self::$instance;
	}

}
